<?php

Route::post('admin/admin/getArr', 'Modules\Admin\Http\Controllers\AdminController@getArr');

Route::post('admin/auth/login', 'Modules\Admin\Http\Controllers\AuthController@login');

Route::get('admin/attach/downFile/{id}', 'Modules\Admin\Http\Controllers\AttachController@downFile');

$middleware = ['auth:admin']; # 加载中间件

Route::group(['middleware' => $middleware, 'prefix' => 'admin', 'namespace' => 'Modules\Admin\Http\Controllers'], function()
{

    Route::group(['prefix' => 'auth'], function () {
        Route::post('logout', 'AuthController@logout');

        Route::post('refresh', 'AuthController@refresh');

        Route::post('register', 'AuthController@register');

        Route::post('me', 'AuthController@me');
    });

    Route::group(['prefix' => 'admin'], function () {
        Route::post('getList', 'AdminController@getList');

        Route::post('add', 'AdminController@add');

        Route::post('detail/{id}', 'AdminController@detail');

        Route::post('edit/{id}', 'AdminController@edit');

        Route::post('remove/{id}', 'AdminController@remove');

        Route::post('resetPwd/{id}', 'AdminController@resetPwd');
    });

    Route::group(['prefix' => 'task'], function () {
        Route::post('getList', 'TaskController@getList');

        Route::post('add', 'TaskController@add');

        Route::post('detail/{id}', 'TaskController@detail');

        Route::post('edit/{id}', 'TaskController@edit');

        Route::post('remove/{id}', 'TaskController@remove');

        Route::post('start/{id}', 'TaskController@start');

        Route::post('finish/{id}', 'TaskController@finish');

        Route::post('cancel/{id}', 'TaskController@cancel');

        Route::post('my', 'TaskController@my');

        Route::post('assign/{id}', 'TaskController@assign');

        Route::post('log/{id}', 'TaskController@log');

        Route::post('info', 'TaskController@info');
    });



    Route::group(['prefix' => 'attach'], function () {

        Route::post('add', 'AttachController@add');

        Route::post('download/{id}', 'AttachController@download');
    });


});
